<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>邀请列表</title>
<link rel="stylesheet" type="text/css" href="../img/base.css">
<script language="javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" src="../js/jquery.js"></script>
<script>
function check_send()
{
	var type = $("input[@type=radio][@checked]").val();
	if(!type)
	{
		alert("请选择发送对象");
		return false;
	}
	else if($("#content").val().replace(/\s/ig,'') == '')
	{
		alert("请填写短信内容");
		return false;
	}
	
	if(type == 1 && $("#mobile").val().replace(/\s/ig,'') == '')
	{
		alert("请填写手机号码");
		return false;
	}
	
	if(type == 2 && $("#user_name").val().replace(/\s/ig,'') == '')
	{
		alert("请填写会员名称");
		return false;
	}
	
	if(type == 3 && $("#excel_file").val() == '')
	{
		alert("请选择Excel文件");
		return false;
	}
	
	var ret = confirm("确定发送吗？");
	
	return ret;
}

function selType(){
	$("#mobile").attr('disabled', 'disabled');
	$("#user_name").attr('disabled', 'disabled');
	$("#excel_file").attr('disabled', 'disabled');
	
	var v = $('input:radio[name="type"]:checked').val();
	if(!v){
		return ;
	}
	if(v=='1'){
		$("#mobile").removeAttr('disabled');
	}else if(v=='2'){
		$("#user_name").removeAttr('disabled');
	}else if(v=='3'){
		$("#excel_file").removeAttr('disabled');
	}
}

$(document).ready(function(){
	$('input:radio[name="type"]').click(function(){
		selType();
	});
	
	selType();
});

</script>
</head>
<body leftmargin="8" topmargin="8" background='../img/allbg.gif'>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td align='center' valign='top'>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr bgcolor="#FFFFFF">
                	<td height="4"></td>
                </tr>
			</table>
            <form action="msg_send.php" method="post" onSubmit="return check_send()" target="sent_cue" enctype="multipart/form-data">
            <table width="100%" border="0" cellpadding="2" cellspacing="5" background="../img/tbg.gif">
                <tr>
    				<td height="30">
                  	<input name="type" type="radio" value="1" /> 手机号码
			    </td>
                    <td>
                    	<textarea name="mobile" cols="80" rows="3" id="mobile"></textarea>&nbsp;*多个请用英文逗号 , 分隔
                    </td>
    			</tr>
                <tr>
    				<td height="30">
                  	<input type="radio" value="2" name="type" /> 会员名
    				</td>
                    <td>
                    	<textarea name="user_name" cols="80" rows="3" id="user_name"></textarea>&nbsp;*多个请用英文逗号 , 分隔
                    </td>
    			</tr>
                <tr>
    				<td height="30">
                  	<input type="radio" value="3" name="type" /> 上传文件
    				</td>
                    <td>
                    	<input name="excel_file" type="file" id="excel_file" value="" size="40" accept="application/msexcel" /> * 请上传 CSV ( <a href="example.csv"  title="下载示例">*.csv</a> ) 或 Excel ( <a href="example.xls" title="下载示例">*.xls</a> &nbsp; <a href="example.xlsx" title="下载示例">*.xlsx</a> )文件，第一列作为手机号。 </td>
    			</tr>
                <tr>
    				<td height="30" width="150">
                  	<input type="radio" value="4" name="type" /> 全部会员
    				</td>
                    <td><span style="color:red;">* 发送短信给“会员列表”的所有会员</span></td>
    			</tr>
                <tr>
    				<td height="30" width="150">
                  	短信内容：
    				</td>
                    <td>
                    <textarea name="content" cols="80" rows="5" id="content"></textarea>
                    <input type="submit" value=" 开始发送 " name="send" />
                    <a href="msg_send.php?type=-1" id="stoppost" target="sent_cue">停止发送</a>
                    </td> 
    			</tr>
            </table>
            </form>

			
			<table width="100%" border="1" cellspacing="0" cellpadding="0">
                <tr>
                	<td height="4"></td>
                </tr>
                <tr bgcolor="#FFFFFF">
                	<td height="1"></td>
                </tr>
				<tr>
					<td height="300">
                    <iframe name="sent_cue" frameborder="0" id="sent_cue" width="100%" height="100%"></iframe>
                    </td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>